package com.swufe.scoresforapp;

import com.swufe.scoresforapp.Yonghu.Dataimport;
import com.swufe.scoresforapp.bean.user;

import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Collection {
    public static user getUser(String uid){
        user u = new user();
        Dataimport in = new Dataimport();
        try{
           PreparedStatement ps = in.getCon().prepareStatement("select * from 用户信息表 where 用户账号='"+uid+"'");
           ResultSet rs = ps.executeQuery();
            if (rs.next()) {
                u.setUid(uid);
                u.setUplace(rs.getString(3));
                u.setUgrade(rs.getInt(4));
                u.setUkelei(rs.getString(5));
                u.setUyear(rs.getInt(6));
            }
            in.closeCon();
        } catch (Exception e) {
            System.out.println(e);
        }
        return u;
    }
}
